<!DOCTYPE html>
<html>
{include file="public/header" /}
<body>


<div class="layui-fluid" id="app">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">


            <div class="layui-card">
                <!--<div class="layui-card-header">云存储</div>-->
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
                        <ul class="layui-tab-title">

                            <li class="layui-this">微信API</li>
                            <li class="">消息模板</li>
                            <li class="">消息测试</li>


                        </ul>
                        <div class="layui-tab-content" style="margin-top: 10px">


                            <div class="layui-tab-item layui-show">
                                <div class="layui-form" wid150="" lay-filter="">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">appid</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="appid" value="{$item.appid}" lay-verify="required"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">appsecret</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="appsecret" lay-verify="required"
                                                   value="{$item.appsecret}"
                                                   class="layui-input">
                                        </div>
                                    </div>


                                    <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">配置参考</label>
                                        <div class="layui-input-block">
                                            <input type="text" name=""
                                                   value="1.安全中心-》IP白名单"
                                                   readonly
                                                   class="layui-input">

                                            <input type="text" name=""
                                                   value="2.公众号设置-》功能设置【业务域名,JS接口安全域名,网页授权域名】"
                                                   readonly
                                                   class="layui-input">


                                        </div>
                                    </div>


                                    <div class="layui-form-item form-footer2">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit="" lay-filter="set_website">确认保存
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="layui-tab-item ">
                                <div class="layui-form" wid150="" lay-filter="">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">竞标成功提醒</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="jingbiao" value="{$temp.jingbiao}"
                                                   placeholder="请输入"
                                                   lay-verify="required"
                                                   class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-form-item">

                                        <div class="layui-inline">
                                            <label class="layui-form-label">详细内容</label>
                                            <div class="layui-input-inline">
                                                <p>
                                                    <!--{{first.DATA}}<br>-->
                                                    <!--项目名称：{{keyword1.DATA}}<br>-->
                                                    <!--项目类型：{{keyword2.DATA}}<br>-->
                                                    <!--中标金额：{{keyword3.DATA}}<br>-->
                                                    <!--中标时间：{{keyword4.DATA}}<br>-->
                                                    <!--{{remark.DATA}}-->

                                                    {{first.DATA}}<br>
                                                    项目名称：{{keyword1.DATA}}<br>
                                                    项目阶段：{{keyword2.DATA}}<br>
                                                    项目经理：{{keyword3.DATA}}<br>
                                                    中标时间：{{keyword4.DATA}}<br>
                                                    {{remark.DATA}}
                                                </p>

                                            </div>
                                        </div>

                                        <div class="layui-inline">
                                            <label class="layui-form-label"></label>
                                            <div class="layui-input-inline" style="width: 500px">
                                                <p>
                                                    您好，您所竞标的项目已竞标成功！<br>
                                                    项目名称：HKG香港国际空运拼箱<br>
                                                    项目类型：物流项目<br>
                                                    中标金额：15654<br>
                                                    中标时间：2016-10-25<br>
                                                    点击查看详情
                                                </p>
                                            </div>
                                        </div>


                                    </div>


                                    <div class="layui-form-item">
                                        <label class="layui-form-label">验收成功提醒</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="yanshou" lay-verify="required"
                                                   value="{$temp.yanshou}"
                                                   placeholder="请输入"
                                                   class="layui-input">
                                        </div>
                                    </div>


                                    <div class="layui-form-item">

                                        <div class="layui-inline">
                                            <label class="layui-form-label">详细内容</label>
                                            <div class="layui-input-inline">
                                                <p>

                                                    {{first.DATA}}<br>
                                                    项目监理：{{keyword1.DATA}}<br>
                                                    项目阶段：{{keyword2.DATA}}<br>
                                                    项目地址：{{keyword3.DATA}}<br>
                                                    {{remark.DATA}}

                                                    <!--{{first.DATA}}<br>-->
                                                    <!--施工地址：{{keyword1.DATA}}<br>-->
                                                    <!--项目监理：{{keyword2.DATA}}<br>-->
                                                    <!--联系电话：{{keyword3.DATA}}<br>-->
                                                    <!--{{remark.DATA}}-->
                                                </p>

                                            </div>
                                        </div>

                                        <div class="layui-inline">
                                            <label class="layui-form-label"></label>
                                            <div class="layui-input-inline" style="width: 500px">
                                                <p>

                                                    项目监理XXX已完成材料验收<br>
                                                    施工地址：广东省广州市天河区天河北苑B2-702<br>
                                                    项目监理：刘监理<br>
                                                    联系电话：13800138000<br>
                                                    请点击查看
                                                </p>
                                            </div>
                                        </div>


                                    </div>


                                    <div class="layui-form-item">
                                        <label class="layui-form-label">新订单通知</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="order" lay-verify="required"
                                                   value="{$temp.order}"
                                                   placeholder="请输入"
                                                   class="layui-input">
                                        </div>
                                    </div>


                                    <div class="layui-form-item">

                                        <div class="layui-inline">
                                            <label class="layui-form-label">详细内容</label>
                                            <div class="layui-input-inline">
                                                <p>
                                                    {{first.DATA}}<br>
                                                    订单编号：{{keyword1.DATA}}<br>
                                                    客户经理：{{keyword2.DATA}}<br>
                                                    送货地址：{{keyword4.DATA}}<br>
                                                    送货时间：{{keyword5.DATA}}<br>
                                                    {{remark.DATA}}
                                                </p>

                                            </div>
                                        </div>

                                        <div class="layui-inline">
                                            <label class="layui-form-label"></label>
                                            <div class="layui-input-inline" style="width: 500px">
                                                <p>
                                                    您好，您收到了一个新订单，请尽快接单处理<br>
                                                    订单编号：WX02302301<br>
                                                    客户经理：达芙妮女士<br>
                                                    送货地址：七一路<br>
                                                    送货时间：2015-04-10 <br>
                                                    点击查看订单详情
                                                </p>
                                            </div>
                                        </div>


                                    </div>

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">打款通知</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="dakuan" lay-verify="required"
                                                   value="{$temp.dakuan}"
                                                   placeholder="请输入"
                                                   class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-form-item">

                                        <div class="layui-inline">
                                            <label class="layui-form-label">详细内容</label>
                                            <div class="layui-input-inline">
                                                <p>
                                                    {{first.DATA}}<br>
                                                    姓名：{{keyword1.DATA}}<br>
                                                    银行：{{keyword2.DATA}}<br>
                                                    打款金额：{{keyword3.DATA}}<br>
                                                    打款时间：{{keyword4.DATA}}<br>
                                                    {{remark.DATA}}
                                                </p>

                                            </div>
                                        </div>

                                        <div class="layui-inline">
                                            <label class="layui-form-label"></label>
                                            <div class="layui-input-inline" style="width: 500px">
                                                <p>
                                                    你好，本周已打款<br>
                                                    用户ID：admin<br>
                                                    打款金额：100<br>
                                                    打款时间：2015年11月22日<br>
                                                    感谢您的使用。
                                                </p>
                                            </div>
                                        </div>


                                    </div>


                                    <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">配置参考</label>
                                        <div class="layui-input-block">
                                            <input type="text" name=""
                                                   value="1.接口权限-》模版消息（业务通知）"
                                                   readonly
                                                   class="layui-input">
                                            <input type="text" name=""
                                                   value="2.功能-》模版消息"
                                                   readonly
                                                   class="layui-input">

                                            <input type="text" style="color: red" name=""
                                                   value="注意:只有关注公众号后才能发送通知。另外 微信审核较严苛，尽量不要改变标题"
                                                   readonly
                                                   class="layui-input">


                                        </div>
                                    </div>


                                    <div class="layui-form-item form-footer2">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit="" lay-filter="set_temp">确认保存
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </div>

                            <div class="layui-tab-item ">

                                <div class="layui-form" wid150="" lay-filter="">


                                    <div class="layui-form-item">
                                        <label class="layui-form-label">模板ID</label>
                                        <div class="layui-input-block">
                                            <select name="temp_id" lay-verify="required">

                                                <option value=""></option>
                                                <option value="jingbiao">竞标成功提醒</option>
                                                <option value="yanshou">验收成功提醒</option>
                                                <option value="order">新订单通知</option>
                                                <option value="dakuan">打款通知</option>

                                            </select>
                                        </div>
                                    </div>

                                    <div class="layui-form-item">

                                        <div class="layui-inline">
                                            <label class="layui-form-label">接收人</label>
                                            <div class="layui-input-inline" style="width: 800px">
                                                <input type="text" name="openid"
                                                       placeholder="请输入 oenid"
                                                       lay-verify="required"
                                                       class="layui-input">
                                            </div>
                                        </div>

                                        <div class="layui-inline">
                                            <label class="layui-form-label"></label>
                                            <div class="layui-input-inline" style="width: 500px">
                                                <p>
                                                    您好，您收到了一个新订单，请尽快接单处理<br>
                                                    订单编号：WX02302301<br>
                                                    客户经理：达芙妮女士<br>
                                                    送货地址：七一路<br>
                                                    送货时间：2015-04-10 <br>
                                                    点击查看订单详情
                                                </p>
                                            </div>
                                        </div>

                                        <div class="layui-form-item layui-form-text">
                                            <label class="layui-form-label">配置参考</label>
                                            <div class="layui-input-block">
                                                <input type="text" name=""
                                                       value="1.接口权限-》模版消息（业务通知）"
                                                       readonly
                                                       class="layui-input">
                                                <input type="text" name=""
                                                       value="2.功能-》模版消息"
                                                       readonly
                                                       class="layui-input">

                                                <input type="text" style="color: red" name=""
                                                       value="注意:只有关注公众号后才能发送通知。另外 微信审核较严苛，尽量不要改变标题"
                                                       readonly
                                                       class="layui-input">


                                            </div>
                                        </div>


                                    </div>


                                    <div class="layui-form-item form-footer2">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit="" lay-filter="temp_test">测试发送
                                            </button>
                                        </div>
                                    </div>


                                </div>

                            </div>


                        </div>
                    </div>
                </div>
            </div>


        </div>


    </div>
</div>

<script>


    layui.use(['form', 'element'], function () {
        var $ = layui.$
            , layer = layui.layer
            , element = layui.element
            , form = layui.form;

        //网站设置
        form.on('submit(set_website)', function (obj) {
            //layer.msg(JSON.stringify(obj.field));
            $.post("{:url('wxconfig')}", obj.field, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1})
                    return false;
                } else {
                    layer.msg(res.msg, {icon: 2})
                    return false;
                }

            });
            return false;
        });

        //网站设置
        form.on('submit(set_temp)', function (obj) {
            //layer.msg(JSON.stringify(obj.field));
            $.post("{:url('set_temp')}", obj.field, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1})
                    return false;
                } else {
                    layer.msg(res.msg, {icon: 2})
                    return false;
                }

            });
            return false;
        });

        //模板测试
        form.on('submit(temp_test)', function (obj) {
            //layer.msg(JSON.stringify(obj.field));
            $.post("{:url('temp_test')}", obj.field, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1})
                    return false;
                } else {
                    layer.msg(res.msg, {icon: 2})
                    return false;
                }

            });
            return false;
        });


    });

</script>
</body>
</html>




